<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ page isELIgnored="false"%>

<html>
<head>
<title>系统后台主页</title>
<link rel="stylesheet" type="text/css" href="${ctxStatic}/jquery-easyui-1.4.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctxStatic}/jquery-easyui-1.4.5/themes/icon.css">
<script type="text/javascript" src="${ctxStatic}/jquery-easyui-1.4.5/jquery.min.js"> </script>
<script type="text/javascript" src="${ctxStatic}/jquery-easyui-1.4.5/jquery.easyui.min.js"> </script>
<script type="text/javascript" src="${ctxStatic}/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"> </script>

<style type="text/css">
 #sys_manage input {           
       background-color: Transparent; 
       border-style:none;     
       outline: none;    
       padding: 8px 15px;
       background: #EFF6FF;
       margin: 0px;
       width: 100%;
       display: inline-table;
       border-bottom:1px solid #D1E0F6;
  }

</style>
</head>
<body class="easyui-layout" >
	<!--top开始-->
	<div data-options="region:'north',split:false,collapsible:false" border="false"
		 style="height: 90px;
		 background:-webkit-gradient(linear, 0% 0%, 0% 100%,from(#EFF6FF), to(#fafafa)); ">
		<div style="float: right;padding-top: 48px;padding-right: 16px;">
		
			欢迎<c var="user" items="${user}"> 
				  <a herf="#" onclick="javaScript:alert('待续');"
				  	class="easyui-linkbutton" plain="true"> ${user.uname}</a> 
			  </c>, 
			<a id="btn" onclick="out()" href="#" class="easyui-linkbutton" plain="true">
				<span style="color:#D1E0F6;">[安全退出]</span>
			</a>
		</div>
	</div>
	<!--top结束-->
	<!--right开始-->
	<!-- <div data-options="region:'east',title:'右',split:true" style="width:100px;">
	
	  </div> -->
	<!--right结束-->
	<!--left开始-->
	<div data-options="region:'west',split:true,collapsible:false,"
		style="width:200px;">
		<div id="aa" class="easyui-accordion"
			style="width: 300px; height: 200px;padding: 0px;" fit="true">
			<div title="系统管理" id="sys_manage" data-options="selected:true"
				style="overflow: auto; padding: 0px;">
				<input type="button" style="text-align:left;" onclick="addPanel(this.value)" value="用户列表"><br>
            	<input type="button" style="text-align:left;" onclick="addPanel(this.value)" value="部门列表"><br>
            	<input type="button" style="text-align:left;" onclick="addPanel(this.value)" value="角色列表"><br>
            	<input type="button" style="text-align:left;" onclick="addPanel(this.value)" value="资源列表">
			</div>
			<div title="日志管理"
				data-options=""
				style="padding: 12px;">content2</div>
			<div title="公共信息" style="padding: 12px;">content3</div>
		</div>
	</div>
	<!--left结束-->
	<!--center开始-->
	<div id="center_panel" class="easyui-tabs" 
		data-options="region:'center',fit:true,border:false,narrow:true" 
		style="padding: 0px; background: #eee;" >
		<div title="首页" style="padding: 20px; 
		display: none; overflow: auto;
		background:-webkit-gradient(linear, 0% 0%, 0% 100%,from(#EFF6FF),to(#fafafa));" >
		<h2>OA办公系统</h2>
		<h3 style="color:#0099FF;">Office Automation</h3>   
        
		</div>
	</div>
	<!--center结束-->
	<!--bottom开始-->
	<div data-options="region:'south',split:false,collapsible:false"
		style="height: 36px;"></div>
	<!--bottom结束-->
</body>
<script>
	function out() {
		$.messager.confirm('确认', '确认退出登录', function(r) {
			if (r) {
				//$.messager.alert('提示', '已退出登录');
				location.href = "${mainPath}/login";
			} else {
				
			}});
	}

	/* $(function(){
		var item=new Array("用户列表","部门列表","角色列表","资源列表");
		var sys_manarge=document.getElementById('sys_manage');
		for(var i=0;i<item.length;i++){
			var btn = document.createElement('a');
		    btn.className='easyui-linkbutton';
		    btn.onclick='';
		    item[i]=btn.value;
		    sys_manarge.appendChild(btn);	
		}
	}); */
	function addPanel(even){
		
		if($('#center_panel').tabs('exists', even)){ //判断选项卡是否存在	
			$('#center_panel').tabs('select', even) //存在就就选中
		}else{
			$('#center_panel').tabs('add',{    
			    title: even,    
			    href:'${mainPath}/tabdata?key='+even, 
			    closable:true, 
			});
			//alert(${mainPath}+"****"+${mainPath}/include/tab.jsp);    
		}
		
	}
	$(function() {
		$('#center_panel').tabs({
			onSelect:function(title,index){
				// 更新选择的面板的新标题和内容
				if(index>0){
					var tab = $('#center_panel').tabs('getSelected');  // 获取选择的面板
					$('#center_panel').tabs('update', {
						tab: tab,
						options: {
							title: title,
							href:'${mainPath}/tabdata?key='+title,  //新内容的URL
						}
					}); 
				}
			}
		}) 
	});
	


	
</script>
</html>